﻿
var log = require('/node/chat/lib/log')(module);

module.exports = function(server) {
  var io = require('socket.io').listen(server);
  io.set('origins', 'localhost:*');
  io.set('logger', log);

  io.sockets.on('connection', function (socket) {
  
    socket.on('message', function (text, cb) {
      //console.log(data);
      socket.broadcast.emit('message', text);
	  cb("123");
    });
  });
};